<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>ESP8266_RTOS_SDK: ESP-NOW APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266_RTOS_SDK
   &#160;<span id="projectnumber">v1.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ESP-NOW APIs</div>  </div>
</div><!--header-->
<div class="contents">

<p>ESP-NOW APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gadd5a6237e11ed8513c4956f6109730a7"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gadd5a6237e11ed8513c4956f6109730a7">esp_now_recv_cb_t</a>) (uint8 *mac_addr, uint8 *data, uint8 len)</td></tr>
<tr class="memdesc:gadd5a6237e11ed8513c4956f6109730a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">ESP-NOW send callback.  <a href="#gadd5a6237e11ed8513c4956f6109730a7">More...</a><br /></td></tr>
<tr class="separator:gadd5a6237e11ed8513c4956f6109730a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d05ff4fff6db81409e30f7e7e5d48c7"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga5d05ff4fff6db81409e30f7e7e5d48c7">esp_now_send_cb_t</a>) (uint8 *mac_addr, uint8 status)</td></tr>
<tr class="memdesc:ga5d05ff4fff6db81409e30f7e7e5d48c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">ESP-NOW send callback.  <a href="#ga5d05ff4fff6db81409e30f7e7e5d48c7">More...</a><br /></td></tr>
<tr class="separator:ga5d05ff4fff6db81409e30f7e7e5d48c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gab0beb43dcd1c75af849dc13182c7a5fb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab0beb43dcd1c75af849dc13182c7a5fb"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>esp_now_role</b> { <b>ESP_NOW_ROLE_IDLE</b> = 0, 
<b>ESP_NOW_ROLE_CONTROLLER</b>, 
<b>ESP_NOW_ROLE_SLAVE</b>, 
<b>ESP_NOW_ROLE_MAX</b>
 }<tr class="separator:gab0beb43dcd1c75af849dc13182c7a5fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga407ae697a77bd49ade96fc2a72f49636"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga407ae697a77bd49ade96fc2a72f49636">esp_now_init</a> (void)</td></tr>
<tr class="memdesc:ga407ae697a77bd49ade96fc2a72f49636"><td class="mdescLeft">&#160;</td><td class="mdescRight">ESP-NOW initialization.  <a href="#ga407ae697a77bd49ade96fc2a72f49636">More...</a><br /></td></tr>
<tr class="separator:ga407ae697a77bd49ade96fc2a72f49636"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a85f4807948eaa75b76ebef7cad1a22"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga5a85f4807948eaa75b76ebef7cad1a22">esp_now_deinit</a> (void)</td></tr>
<tr class="memdesc:ga5a85f4807948eaa75b76ebef7cad1a22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize ESP-NOW.  <a href="#ga5a85f4807948eaa75b76ebef7cad1a22">More...</a><br /></td></tr>
<tr class="separator:ga5a85f4807948eaa75b76ebef7cad1a22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6dbbbb859a5d37c2b74a79baaa8011f0"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga6dbbbb859a5d37c2b74a79baaa8011f0">esp_now_register_send_cb</a> (<a class="el" href="group__ESPNow__APIs.html#ga5d05ff4fff6db81409e30f7e7e5d48c7">esp_now_send_cb_t</a> cb)</td></tr>
<tr class="memdesc:ga6dbbbb859a5d37c2b74a79baaa8011f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register ESP-NOW send callback.  <a href="#ga6dbbbb859a5d37c2b74a79baaa8011f0">More...</a><br /></td></tr>
<tr class="separator:ga6dbbbb859a5d37c2b74a79baaa8011f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacf2a9263a2f55d55440dbf7ca2b43709"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gacf2a9263a2f55d55440dbf7ca2b43709">esp_now_unregister_send_cb</a> (void)</td></tr>
<tr class="memdesc:gacf2a9263a2f55d55440dbf7ca2b43709"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister ESP-NOW send callback.  <a href="#gacf2a9263a2f55d55440dbf7ca2b43709">More...</a><br /></td></tr>
<tr class="separator:gacf2a9263a2f55d55440dbf7ca2b43709"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3488572d55b5b2f3748a7a87e902a0f"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gaf3488572d55b5b2f3748a7a87e902a0f">esp_now_register_recv_cb</a> (<a class="el" href="group__ESPNow__APIs.html#gadd5a6237e11ed8513c4956f6109730a7">esp_now_recv_cb_t</a> cb)</td></tr>
<tr class="memdesc:gaf3488572d55b5b2f3748a7a87e902a0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register ESP-NOW receive callback.  <a href="#gaf3488572d55b5b2f3748a7a87e902a0f">More...</a><br /></td></tr>
<tr class="separator:gaf3488572d55b5b2f3748a7a87e902a0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac4facb9a7ec9bf4c7c0e18054664b03"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gaac4facb9a7ec9bf4c7c0e18054664b03">esp_now_unregister_recv_cb</a> (void)</td></tr>
<tr class="memdesc:gaac4facb9a7ec9bf4c7c0e18054664b03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister ESP-NOW receive callback.  <a href="#gaac4facb9a7ec9bf4c7c0e18054664b03">More...</a><br /></td></tr>
<tr class="separator:gaac4facb9a7ec9bf4c7c0e18054664b03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2ef5f592b161d885b6f0d8dde18ff802"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga2ef5f592b161d885b6f0d8dde18ff802">esp_now_send</a> (uint8 *da, uint8 *data, uint8 len)</td></tr>
<tr class="memdesc:ga2ef5f592b161d885b6f0d8dde18ff802"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send ESP-NOW packet.  <a href="#ga2ef5f592b161d885b6f0d8dde18ff802">More...</a><br /></td></tr>
<tr class="separator:ga2ef5f592b161d885b6f0d8dde18ff802"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga780113b4069cbf971a58353987d25240"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga780113b4069cbf971a58353987d25240">esp_now_add_peer</a> (uint8 *mac_addr, uint8 role, uint8 channel, uint8 *key, uint8 key_len)</td></tr>
<tr class="memdesc:ga780113b4069cbf971a58353987d25240"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an ESP-NOW peer, store MAC address of target device into ESP-NOW MAC list.  <a href="#ga780113b4069cbf971a58353987d25240">More...</a><br /></td></tr>
<tr class="separator:ga780113b4069cbf971a58353987d25240"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab5b0ca5ece92af7fb04c27a8c1bfce4d"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gab5b0ca5ece92af7fb04c27a8c1bfce4d">esp_now_del_peer</a> (uint8 *mac_addr)</td></tr>
<tr class="memdesc:gab5b0ca5ece92af7fb04c27a8c1bfce4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete an ESP-NOW peer, delete MAC address of the device from ESP-NOW MAC list.  <a href="#gab5b0ca5ece92af7fb04c27a8c1bfce4d">More...</a><br /></td></tr>
<tr class="separator:gab5b0ca5ece92af7fb04c27a8c1bfce4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga08297bacf8c88648d09c11ba3b69d594"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga08297bacf8c88648d09c11ba3b69d594">esp_now_set_self_role</a> (uint8 role)</td></tr>
<tr class="memdesc:ga08297bacf8c88648d09c11ba3b69d594"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set ESP-NOW role of device itself.  <a href="#ga08297bacf8c88648d09c11ba3b69d594">More...</a><br /></td></tr>
<tr class="separator:ga08297bacf8c88648d09c11ba3b69d594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5838cbb89faf492c4904fab6d83b87bb"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga5838cbb89faf492c4904fab6d83b87bb">esp_now_get_self_role</a> (void)</td></tr>
<tr class="memdesc:ga5838cbb89faf492c4904fab6d83b87bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get ESP-NOW role of device itself.  <a href="#ga5838cbb89faf492c4904fab6d83b87bb">More...</a><br /></td></tr>
<tr class="separator:ga5838cbb89faf492c4904fab6d83b87bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7a5f50b81300b3b8ae403854d76901a3"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga7a5f50b81300b3b8ae403854d76901a3">esp_now_set_peer_role</a> (uint8 *mac_addr, uint8 role)</td></tr>
<tr class="memdesc:ga7a5f50b81300b3b8ae403854d76901a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set ESP-NOW role for a target device. If it is set multiple times, new role will cover the old one.  <a href="#ga7a5f50b81300b3b8ae403854d76901a3">More...</a><br /></td></tr>
<tr class="separator:ga7a5f50b81300b3b8ae403854d76901a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0629a89cf89b13439f8306fe0ba95023"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga0629a89cf89b13439f8306fe0ba95023">esp_now_get_peer_role</a> (uint8 *mac_addr)</td></tr>
<tr class="memdesc:ga0629a89cf89b13439f8306fe0ba95023"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get ESP-NOW role of a target device.  <a href="#ga0629a89cf89b13439f8306fe0ba95023">More...</a><br /></td></tr>
<tr class="separator:ga0629a89cf89b13439f8306fe0ba95023"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga49e3aa3ba63d7883124e1dfcf2a0533b"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga49e3aa3ba63d7883124e1dfcf2a0533b">esp_now_set_peer_channel</a> (uint8 *mac_addr, uint8 channel)</td></tr>
<tr class="memdesc:ga49e3aa3ba63d7883124e1dfcf2a0533b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Record channel information of a ESP-NOW device.  <a href="#ga49e3aa3ba63d7883124e1dfcf2a0533b">More...</a><br /></td></tr>
<tr class="separator:ga49e3aa3ba63d7883124e1dfcf2a0533b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga42cd1efe5ef32d2f35682bccddb5d83e"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga42cd1efe5ef32d2f35682bccddb5d83e">esp_now_get_peer_channel</a> (uint8 *mac_addr)</td></tr>
<tr class="memdesc:ga42cd1efe5ef32d2f35682bccddb5d83e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get channel information of a ESP-NOW device.  <a href="#ga42cd1efe5ef32d2f35682bccddb5d83e">More...</a><br /></td></tr>
<tr class="separator:ga42cd1efe5ef32d2f35682bccddb5d83e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga936b9caa1127d362aa63225f865afd99"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga936b9caa1127d362aa63225f865afd99">esp_now_set_peer_key</a> (uint8 *mac_addr, uint8 *key, uint8 key_len)</td></tr>
<tr class="memdesc:ga936b9caa1127d362aa63225f865afd99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set ESP-NOW key for a target device.  <a href="#ga936b9caa1127d362aa63225f865afd99">More...</a><br /></td></tr>
<tr class="separator:ga936b9caa1127d362aa63225f865afd99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b2c449a35daf4c91e51496f7622f2a0"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga6b2c449a35daf4c91e51496f7622f2a0">esp_now_get_peer_key</a> (uint8 *mac_addr, uint8 *key, uint8 *key_len)</td></tr>
<tr class="memdesc:ga6b2c449a35daf4c91e51496f7622f2a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get ESP-NOW key of a target device.  <a href="#ga6b2c449a35daf4c91e51496f7622f2a0">More...</a><br /></td></tr>
<tr class="separator:ga6b2c449a35daf4c91e51496f7622f2a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaffa4f035416078c3d0dbf34f2d67795a"><td class="memItemLeft" align="right" valign="top">uint8 *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gaffa4f035416078c3d0dbf34f2d67795a">esp_now_fetch_peer</a> (bool restart)</td></tr>
<tr class="memdesc:gaffa4f035416078c3d0dbf34f2d67795a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get MAC address of ESP-NOW device.  <a href="#gaffa4f035416078c3d0dbf34f2d67795a">More...</a><br /></td></tr>
<tr class="separator:gaffa4f035416078c3d0dbf34f2d67795a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga735fbbcc99172abd887d1e248a7e9fb3"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga735fbbcc99172abd887d1e248a7e9fb3">esp_now_is_peer_exist</a> (uint8 *mac_addr)</td></tr>
<tr class="memdesc:ga735fbbcc99172abd887d1e248a7e9fb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if target device exists or not.  <a href="#ga735fbbcc99172abd887d1e248a7e9fb3">More...</a><br /></td></tr>
<tr class="separator:ga735fbbcc99172abd887d1e248a7e9fb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga59320ae71ba3f4d4b2904e69ce7b72f2"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#ga59320ae71ba3f4d4b2904e69ce7b72f2">esp_now_get_cnt_info</a> (uint8 *all_cnt, uint8 *encrypt_cnt)</td></tr>
<tr class="memdesc:ga59320ae71ba3f4d4b2904e69ce7b72f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the total number of ESP-NOW devices which are associated, and the number count of encrypted devices.  <a href="#ga59320ae71ba3f4d4b2904e69ce7b72f2">More...</a><br /></td></tr>
<tr class="separator:ga59320ae71ba3f4d4b2904e69ce7b72f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab9b169f115cffd354637c79d2a16789"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ESPNow__APIs.html#gaab9b169f115cffd354637c79d2a16789">esp_now_set_kok</a> (uint8 *key, uint8 len)</td></tr>
<tr class="memdesc:gaab9b169f115cffd354637c79d2a16789"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the encrypt key of communication key.  <a href="#gaab9b169f115cffd354637c79d2a16789">More...</a><br /></td></tr>
<tr class="separator:gaab9b169f115cffd354637c79d2a16789"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>ESP-NOW APIs. </p>
<dl class="section attention"><dt>Attention</dt><dd>1. ESP-NOW do not support broadcast and multicast. </dd>
<dd>
2. ESP-NOW is targeted to Smart-Light project, so it is suggested that slave role corresponding to soft-AP or soft-AP+station mode, controller role corresponding to station mode. </dd>
<dd>
3. When ESP8266 is in soft-AP+station mode, it will communicate through station interface if it is in slave role, and communicate through soft-AP interface if it is in controller role. </dd>
<dd>
4. ESP-NOW can not wake ESP8266 up from sleep, so if the target ESP8266 station is in sleep, ESP-NOW communication will fail. </dd>
<dd>
5. In station mode, ESP8266 supports 10 encrypt ESP-NOW peers at most, with the unencrypted peers, it can be 20 peers in total at most. </dd>
<dd>
6. In the soft-AP mode or soft-AP + station mode, the ESP8266 supports 6 encrypt ESP-NOW peers at most, with the unencrypted peers, it can be 20 peers in total at most. </dd></dl>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gadd5a6237e11ed8513c4956f6109730a7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* esp_now_recv_cb_t) (uint8 *mac_addr, uint8 *data, uint8 len)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>ESP-NOW send callback. </p>
<dl class="section attention"><dt>Attention</dt><dd>The status will be OK, if ESP-NOW send packet successfully. But users need to make sure by themselves that key of communication is correct.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device </td></tr>
    <tr><td class="paramname">uint8</td><td>*data : data received </td></tr>
    <tr><td class="paramname">uint8</td><td>len : data length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<a class="anchor" id="ga5d05ff4fff6db81409e30f7e7e5d48c7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* esp_now_send_cb_t) (uint8 *mac_addr, uint8 status)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>ESP-NOW send callback. </p>
<dl class="section attention"><dt>Attention</dt><dd>The status will be OK, if ESP-NOW send packet successfully. But users need to make sure by themselves that key of communication is correct.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device </td></tr>
    <tr><td class="paramname">uint8</td><td>status : status of ESP-NOW sending packet, 0, OK; 1, fail.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga780113b4069cbf971a58353987d25240"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_add_peer </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>role</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>key_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add an ESP-NOW peer, store MAC address of target device into ESP-NOW MAC list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of device </td></tr>
    <tr><td class="paramname">uint8</td><td>role : role type of device, enum esp_now_role </td></tr>
    <tr><td class="paramname">uint8</td><td>channel : channel of device </td></tr>
    <tr><td class="paramname">uint8</td><td>*key : 16 bytes key which is needed for ESP-NOW communication </td></tr>
    <tr><td class="paramname">uint8</td><td>key_len : length of key, has to be 16 bytes now</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga5a85f4807948eaa75b76ebef7cad1a22"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_deinit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize ESP-NOW. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gab5b0ca5ece92af7fb04c27a8c1bfce4d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_del_peer </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete an ESP-NOW peer, delete MAC address of the device from ESP-NOW MAC list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">u8</td><td>*mac_addr : MAC address of device</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gaffa4f035416078c3d0dbf34f2d67795a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8* esp_now_fetch_peer </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>restart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get MAC address of ESP-NOW device. </p>
<p>Get MAC address of ESP-NOW device which is pointed now, and move the pointer to next one in ESP-NOW MAC list or move the pointer to the first one in ESP-NOW MAC list.</p>
<dl class="section attention"><dt>Attention</dt><dd>1. This API can not re-entry </dd>
<dd>
2. Parameter has to be true when you call it the first time.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bool</td><td>restart : true, move pointer to the first one in ESP-NOW MAC list; false, move pointer to the next one in ESP-NOW MAC list</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NULL, no ESP-NOW devices exist </dd>
<dd>
Otherwise, MAC address of ESP-NOW device which is pointed now </dd></dl>

</div>
</div>
<a class="anchor" id="ga59320ae71ba3f4d4b2904e69ce7b72f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_get_cnt_info </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>all_cnt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>encrypt_cnt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the total number of ESP-NOW devices which are associated, and the number count of encrypted devices. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*all_cnt : total number of ESP-NOW devices which are associated. </td></tr>
    <tr><td class="paramname">uint8</td><td>*encryp_cnt : number count of encrypted devices</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga42cd1efe5ef32d2f35682bccddb5d83e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_get_peer_channel </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get channel information of a ESP-NOW device. </p>
<dl class="section attention"><dt>Attention</dt><dd>ESP-NOW communication needs to be at the same channel.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 ~ 13 (some area may get 14) : channel number </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga6b2c449a35daf4c91e51496f7622f2a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_get_peer_key </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>key_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get ESP-NOW key of a target device. </p>
<p>If it is set multiple times, new key will cover the old one.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device. </td></tr>
    <tr><td class="paramname">uint8</td><td>*key : pointer of key, buffer size has to be 16 bytes at least </td></tr>
    <tr><td class="paramname">uint8</td><td>key_len : key length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
&gt; 0 : find target device but can't get key </dd>
<dd>
&lt; 0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga0629a89cf89b13439f8306fe0ba95023"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_get_peer_role </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get ESP-NOW role of a target device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ESP_NOW_ROLE_CONTROLLER, role type : controller </dd>
<dd>
ESP_NOW_ROLE_SLAVE, role type : slave </dd>
<dd>
otherwise : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga5838cbb89faf492c4904fab6d83b87bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_get_self_role </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get ESP-NOW role of device itself. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>role : role type of device, enum esp_now_role.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga407ae697a77bd49ade96fc2a72f49636"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>ESP-NOW initialization. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga735fbbcc99172abd887d1e248a7e9fb3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_is_peer_exist </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if target device exists or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : device does not exist </dd>
<dd>
&lt; 0 : error occur, check fail </dd>
<dd>
&gt; 0 : device exists </dd></dl>

</div>
</div>
<a class="anchor" id="gaf3488572d55b5b2f3748a7a87e902a0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_register_recv_cb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ESPNow__APIs.html#gadd5a6237e11ed8513c4956f6109730a7">esp_now_recv_cb_t</a>&#160;</td>
          <td class="paramname"><em>cb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register ESP-NOW receive callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">esp_now_recv_cb_t</td><td>cb : receive callback</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga6dbbbb859a5d37c2b74a79baaa8011f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_register_send_cb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ESPNow__APIs.html#ga5d05ff4fff6db81409e30f7e7e5d48c7">esp_now_send_cb_t</a>&#160;</td>
          <td class="paramname"><em>cb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register ESP-NOW send callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">esp_now_send_cb_t</td><td>cb : send callback</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga2ef5f592b161d885b6f0d8dde18ff802"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_send </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>da</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send ESP-NOW packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*da : destination MAC address. If it's NULL, send packet to all MAC addresses recorded by ESP-NOW; otherwise, send packet to target MAC address. </td></tr>
    <tr><td class="paramname">uint8</td><td>*data : data need to send </td></tr>
    <tr><td class="paramname">uint8</td><td>len : data length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gaab9b169f115cffd354637c79d2a16789"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_set_kok </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the encrypt key of communication key. </p>
<p>All ESP-NOW devices share the same encrypt key. If users do not set the encrypt key, ESP-NOW communication key will be encrypted by a default key.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*key : pointer of encrypt key. </td></tr>
    <tr><td class="paramname">uint8</td><td>len : key length, has to be 16 bytes now.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga49e3aa3ba63d7883124e1dfcf2a0533b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_set_peer_channel </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>channel</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Record channel information of a ESP-NOW device. </p>
<p>When communicate with this device,</p><ul>
<li>call esp_now_get_peer_channel to get its channel first,</li>
<li>then call wifi_set_channel to be in the same channel and do communication.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device. </td></tr>
    <tr><td class="paramname">uint8</td><td>channel : channel, usually to be 1 ~ 13, some area may use channel 14.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga936b9caa1127d362aa63225f865afd99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_set_peer_key </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>key_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set ESP-NOW key for a target device. </p>
<p>If it is set multiple times, new key will cover the old one.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of target device. </td></tr>
    <tr><td class="paramname">uint8</td><td>*key : 16 bytes key which is needed for ESP-NOW communication, if it is NULL, current key will be reset to be none. </td></tr>
    <tr><td class="paramname">uint8</td><td>key_len : key length, has to be 16 bytes now</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga7a5f50b81300b3b8ae403854d76901a3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_set_peer_role </td>
          <td>(</td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>mac_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>role</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set ESP-NOW role for a target device. If it is set multiple times, new role will cover the old one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*mac_addr : MAC address of device. </td></tr>
    <tr><td class="paramname">uint8</td><td>role : role type, enum esp_now_role.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga08297bacf8c88648d09c11ba3b69d594"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_set_self_role </td>
          <td>(</td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>role</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set ESP-NOW role of device itself. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>role : role type of device, enum esp_now_role.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gaac4facb9a7ec9bf4c7c0e18054664b03"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_unregister_recv_cb </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unregister ESP-NOW receive callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gacf2a9263a2f55d55440dbf7ca2b43709"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 esp_now_unregister_send_cb </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unregister ESP-NOW send callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : fail </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 1 2016 10:19:26 for ESP8266_RTOS_SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
